2 COLOR 7,1,1
3 CTR=1:DONE=1
134 ON DONE GOTO 140
135 C$=RIGHT$(C$+B$,5)
136 IF INSTR(C$,P1$)>0 THEN C$="":GOTO 4870
137 IF INSTR(C$,P2$)>0 THEN C$="":GOTO 4880
138 IF INSTR(C$,P3$)>0 THEN C$="":GOTO 4890
140 IF LL<>IWT OR B$<>CR$ THEN PRINT B$;:IF IPRR THEN L$=B$:GOSUB 95
145 K$=INKEY$:IF PHONE$=""THEN 146 ELSE K$=MID$(PHONE$,CTR,1):CTR=CTR+1:IF CTR>LEN(PHONE$)THEN PHONE$="":CTR=1
146 IF K$="" GOTO 100
147 IF K$="~"THEN 4000
3884 LOCATE 25,31,0:PRINT"F7<";
3887 COLOR ICOL(IPF+1):PRINT"FILEWRITE";:COLOR 7:PRINT">  F9<AUTODIAL>  F10<HELP>";
4000 '*************************************************************************
4010 '*       AUTO DIAL AND LOG-ON FOR IBM ASYNC COMM SUPPORT 2.0             *
4020 '*           BY ROBERT RELF [70176,403] - COPYRIGHT 1983                 *
4030 '*************************************************************************
4040 '*** SAVE THIS PROGRAM WITH THE "A" OPTION AND MERGE IT INTO TERMINAL.BAS
4050 '*** THEN SAVE TERMINAL.BAS BACK TO ITS DISK WITHOUT THE "A" OPTION
4060 '*** FOR MONOCHROME MONITOR DELETE LINES 2,31005,31576,32330 *BEFORE* MERGING
4070 OPEN "B:PHONE.DAT" AS #1 LEN=90        '*** OPEN RANDOM ACCESS FILE
4080 FIELD #1,16 AS NME$,20 AS N$,3 AS P1$,15 AS R1$,3 AS P2$,15 AS R2$,3 AS P3$,15 AS R3$
4090 GET #1,1:IF ASC(NME$)<33 THEN CLS:PRINT "INITIALIZE FILE? ANY DATA WILL BE ";"LOST-- (Y or N)":ELSE 4160
4100 K$=INKEY$:IF K$=""THEN 4100
4110 IF K$="Y"OR K$="y"THEN 4140            '*** CLEAR FILE OF GARBAGE
4120 IF K$="N"OR K$="n"THEN 4160
4130 BEEP:GOTO 4100
4140 FOR X=1 TO 40:PUT #1,X:NEXT:CNTR=0
4150 '*** GET FILE INFO AND FORMAT SCREEN ***
4160 CLS:LOCATE 2,1:FOR I=1 TO 20
4170 GET #1,I:IF ASC(NME$)>32 THEN CNTR=I:PRINT USING "##";I;:PRINT " "+NME$:GOTO 4190
4180 PRINT USING "##";I
4190 NEXT
4200 FOR I=21 TO 40
4210 GET #1,I:IF ASC(NME$)>32 THEN CNTR=I:LOCATE I-19,21:PRINT USING "##";I;:PRINT " "+NME$:GOTO 4230
4220 LOCATE I-19,21:PRINT USING "##";I
4230 NEXT
4240 PRINT "41 ADD NAME TO LISTING"
4250 PRINT "42 DELETE NAME FROM LISTING"
4260 PRINT "43 RETURN TO TERMINAL OPERATION";
4270 '*** MAKE SELECTION OF DESIRED ACTION ***
4280 LOCATE 1,1:PRINT SPACE$(39);
4290 LOCATE 1,1:INPUT "PLEASE ENTER YOUR SELECTION  ",SEL
4300 IF SEL=41 THEN 4380
4310 IF SEL=42 THEN GOSUB 4710:PUT #1,SEL:GOTO 4160
4320 IF SEL=43 THEN GOTO 4850
4330 IF SEL<=CNTR THEN GET #1,SEL:GOTO 4340 ELSE 4360 '*** TEST FOR VALID CHOICE
4340 IF ASC(NME$)>32 THEN PHONE$=LEFT$(N$,INSTR(N$," ")-1) ELSE 4360
4350 IF ASC(P1$)>32 THEN DONE=0:GOTO 4850 ELSE DONE=1:GOTO 4850
4360 BEEP:GOTO 4280
4370 '*** INPUT LISTING INFORMATION ***
4380 CLS:PRINT"ENTER DESIRED POSITION OF LISTING OR ";"<ENTER> TO FOLLOW LAST ENTRY.  ";
4390 INPUT "",SEL:IF SEL=0 THEN SEL=CNTR+1
4400 PRINT "ENTER NAME OF LISTING UP TO 16 CHAR.
4410 INPUT "",NM$:IF NM$="" THEN GOSUB 4750:GOTO 4160 ELSE LSET NME$=NM$
4420 PRINT "ENTER PHONE # UP TO 20 CHARACTERS
4430 INPUT "",NBR$:IF NBR$="" THEN GOSUB 4750:GOTO 4160 ELSE NBR$="ATDT"+NBR$+CHR$(13):LSET N$=NBR$
4440 PRINT "ENTER AUTO LOG-ON ? (Y or N)
4450 K$=INKEY$:IF K$=""THEN 4450
4460 IF K$="Y"OR K$="y"THEN 4490
4470 IF K$="N"OR K$="n"THEN GOSUB 4770:GOTO 4640
4480 BEEP:GOTO 4450
4490 PRINT"ENTER FIRST PROMPT -- ALL PROMPTS ARE ";"LAST 3 CHARACTERS OF SCREEN MESSAGE ";
4495 PRINT"FROM HOST-USE QUOTES IF THERE ARE COMMAS
4500 INPUT "",PRMPT1$:IF PRMPT1$="" THEN GOSUB 4770:GOTO 4640 ELSE LSET P1$=PRMPT1$
4510 PRINT"ENTER FIRST RESPONSE UP TO 20 CHAR.":GOTO 4550
4515 '*************************************************************************
4520 '*** TO ENTER A CONTROL CHARACTER, HOLD DOWN THE "ALT" KEY WHILE TYPING
4530 '*** THE DESIRED ASCII NUMBER PLUS 128 ON THE NUMERIC KEYPAD--FOR EXAMPLE,
4540 '*** TYPE 131 FOR A ^C OR 141 FOR A CARRIAGE RETURN.
4545 '*************************************************************************
4550 INPUT "",RES1$:IF RES1$="" THEN GOSUB 4770:GOTO 4640 ELSE RES1$=RES1$+CHR$(13):LSET R1$=RES1$
4560 PRINT"ENTER SECOND PROMPT
4570 INPUT "",PRMPT2$:IF PRMPT2$="" THEN GOSUB 4790:GOTO 4640 ELSE LSET P2$=PRMPT2$
4580 PRINT"ENTER SECOND RESPONSE
4590 INPUT "",RES2$:IF RES2$="" THEN GOSUB 4790:GOTO 4640 ELSE RES2$=RES2$+CHR$(13):LSET R2$=RES2$
4600 PRINT"ENTER THIRD PROMPT
4610 INPUT "",PRMPT3$:IF PRMPT3$="" THEN GOSUB 4810:GOTO 4640 ELSE LSET P3$=PRMPT3$
4620 PRINT"ENTER THIRD RESPONSE
4630 INPUT"",RES3$:IF RES3$=""THEN GOSUB 4810:GOTO 4640 ELSE RES3$=RES3$+CHR$(13):LSET R3$=RES3$
4640 PRINT"IS ALL INFORMATION CORRECT? (Y or N)
4650 K$=INKEY$:IF K$=""THEN 4650
4660 IF K$="Y"OR K$="y"THEN 4690
4670 IF K$="N"OR K$="n"THEN CLS:GOTO 4400
4680 BEEP:GOTO 4650
4690 PUT #1,SEL:GOTO 4160             '*** WRITE LISTING IN BUFFER TO FILE
4700 '*** DELETE LISTING IN WHOLE OR IN PART ***
4710 LOCATE 1,1:PRINT SPACE$(39);
4720 LOCATE 1,1:INPUT "ENTER # OF LISTING TO DELETE  ",SEL
4730 IF SEL=0 THEN 4160
4740 IF SEL>43 THEN BEEP:GOTO 4710
4750 LSET NME$=""
4760 LSET N$=""
4770 LSET P1$=""
4780 LSET R1$=""
4790 LSET P2$=""
4800 LSET R2$=""
4810 LSET P3$=""
4820 LSET R3$=""
4830 RETURN
4840 '*** RETURN TO TERMINAL OPERATION ***
4850 CLS:CLOSE #1:GOTO 3400
4860 '*** FILL STRING FOR PSEUDO KEYBOARD INPUT TO MAIN PROGRAM ***
4870 PHONE$=LEFT$(R1$,INSTR(R1$," ")-1):IF ASC(P2$)=0 THEN DONE=1 ELSE 140
4880 PHONE$=LEFT$(R2$,INSTR(R2$," ")-1):IF ASC(P3$)=0 THEN DONE=1 ELSE 140
4890 PHONE$=LEFT$(R3$,INSTR(R3$," ")-1):DONE=1:GOTO 140
31005 COLOR 7,1,1
31533 KEY 9,"~"
31576 COLOR 7,1,1:CLS
32330 CLS:KEY OFF:SCREEN 0,1,0:WIDTH 40:COLOR 7,1,1:CLS:RETURN
32490 PRINT"F9 AUTODIAL    F10 This HELP Menu       ";"[ON or OFF] indicates current status.   ";
